function [output] = ook_mod (input, interval)
% Function for OOK Modulation.
% input: a bit sequence
% interval: number of points in one cycle of sine wave.

% Uncomment last line to "see" the output.

output = [];
a = ones(1,interval);
input2 = [a input];
t = 0 : pi/(interval-1) : pi;
len = length(input2);
piece_signal = 5*sin(10*t);
piece_nosignal = zeros(1,interval);

for i=1:len
    if (input2(i) == 0)
        output = [output piece_nosignal];
    else
        output = [output piece_signal];
    end
end

% plot(output);
end